package cn.xiaopengstack.infrastructure.persistent.dao;

import cn.bugstack.middleware.db.router.annotation.DBRouter;
import cn.bugstack.middleware.db.router.annotation.DBRouterStrategy;
import cn.xiaopengstack.infrastructure.persistent.po.RaffleActivityAccountDay;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
* @author jiangyangang
* @description 针对表【raffle_activity_account_day(抽奖活动账户表-日次数)】的数据库操作Mapper
* @createDate 2025-07-02 11:46:22
* @Entity cn.xiaopengstack.infrastructure.persistent.po.RaffleActivityAccountDay
*/
@Mapper
public interface IRaffleActivityAccountDayDao {

    int insert(RaffleActivityAccountDay record);

    int insertSelective(RaffleActivityAccountDay record);

    RaffleActivityAccountDay selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(RaffleActivityAccountDay record);

    int updateByPrimaryKey(RaffleActivityAccountDay record);

    @DBRouter(key = "userId")
    int updateActivityAccountDaySubtractionQuota(RaffleActivityAccountDay raffleActivityAccountDay);

    @DBRouter(key = "userId")
    RaffleActivityAccountDay queryActivityAccountDayByUserId(RaffleActivityAccountDay raffleActivityAccountDay);

    /**
     * 更新日账户额度
     * @param raffleActivityAccountDay
     * @return
     */
    @DBRouter
    int updateAccountQuota(RaffleActivityAccountDay raffleActivityAccountDay);
}
